package com.liuzh.deviceinfo.card;

import android.content.Context;
import android.content.res.Configuration;
import android.graphics.Point;
import android.util.AttributeSet;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.TextView;
import androidx.cardview.widget.CardView;
import c.h.a.m0.h;
import c.h.a.m0.k;
import java.util.Locale;

public class DisplayScreenCard extends CardView {
    public DisplayScreenCard(Context context, AttributeSet attributeSet) {
        TextView textView;
        StringBuilder stringBuilder;
        super(context, attributeSet);
        setUseCompatPadding(true);
        FrameLayout.inflate(getContext(), 2131492928, this);
        String string = getResources().getString(2131690514);
        WindowManager windowManager = (WindowManager) getContext().getSystemService("window");
        String str = "%.2f";
        if (windowManager != null) {
            ((TextView) findViewById(2131296753)).setText(windowManager.getDefaultDisplay().getName());
            Point point = new Point();
            windowManager.getDefaultDisplay().getRealSize(point);
            TextView textView2 = (TextView) findViewById(2131296856);
            StringBuilder stringBuilder2 = new StringBuilder();
            stringBuilder2.append(point.y);
            stringBuilder2.append(getResources().getString(2131690212));
            textView2.setText(stringBuilder2.toString());
            textView2 = (TextView) findViewById(2131296859);
            stringBuilder2 = new StringBuilder();
            stringBuilder2.append(point.x);
            stringBuilder2.append(getResources().getString(2131690212));
            textView2.setText(stringBuilder2.toString());
            textView = (TextView) findViewById(2131296831);
            stringBuilder = new StringBuilder();
            stringBuilder.append(String.format(Locale.US, str, new Object[]{Float.valueOf(r0.getRefreshRate())}));
            stringBuilder.append(getResources().getString(2131689935));
            textView.setText(stringBuilder.toString());
        }
        Configuration configuration = getResources().getConfiguration();
        ((TextView) findViewById(2131296857)).setText(k.G(configuration));
        textView = (TextView) findViewById(2131296795);
        stringBuilder = new StringBuilder();
        stringBuilder.append(String.format(Locale.US, str, new Object[]{Float.valueOf(h.l())}));
        stringBuilder.append(" ");
        stringBuilder.append(getResources().getString(2131690005));
        textView.setText(stringBuilder.toString());
        ((TextView) findViewById(2131296773)).setText(k.F(configuration));
        ((TextView) findViewById(2131296402)).setText(k.k());
        ((TextView) findViewById(2131296858)).setText(k.H());
        String z = k.z();
        if (string.equals(z)) {
            findViewById(2131296779).setVisibility(8);
        } else {
            ((TextView) findViewById(2131296778)).setText(z);
        }
    }
}
